function buildLevelWindow(source,callback){
    
    var proxy = new Ext.data.HttpProxy({
        api: {
            read : 'publicationlevel/get.json',
            create : 'publicationlevel/post.json',
            update: 'publicationlevel/put.json',
            destroy: 'publicationlevel/delete.json'
        }
    });
    
    var store = new Ext.data.Store({
       reader: new Ext.data.JsonReader(jsonReader_config,PublicationLevel),
       writer: new Ext.data.JsonWriter(jsonWriter_config),
       autoLoad:true,
       autoSave:true,
       sortInfo:{field:'name',direction:'ASC'},
       remoteSort:false,
       proxy:proxy,
        batch:false,
        listeners:{
            exception : function(proxy, type, action, options, res, arg) {
                if (type === 'remote')
                    alert_error(res.message + '<br/>' + '(' + arg.data.name + ')');
            }
        }
    });
    
    var editor = new Ext.form.TextField({allowBlank:false});
    
    var grid = new Ext.grid.EditorGridPanel({
        store:store,
        hideHeaders:true,
        loadMask:true,
        autoExpandColumn:'name',
        colModel:new Ext.grid.ColumnModel({
            columns:[
                {dataIndex:'name',id:'name',editor:editor},
                {header:'Acciones',xtype:'actioncolumn',width:30,items:[
                    {tooltip:'Borrar',icon:iconPath('delete'),handler:function(grid,rowIndex){grid.getStore().removeAt(rowIndex);}}
                ]}
            ]
        }),
        selModel:new Ext.grid.RowSelectionModel({})
    });

    var window = new Ext.Window({
        modal:true,
        iconCls:'silk_chart_bar',
        resizable:false,
        layout:'fit',
        width:200,
        height:400,
        tbar:[{
            text:'Nuevo nivel',
            iconCls:'silk_add',
            handler:function(b,e){
                grid.stopEditing();
                store.insert(0, new PublicationLevel());
                grid.startEditing(0, 0);
            }
        }],
        title:'Administrar niveles',
        items:grid,
        listeners:{
            hide:function(this_){
                callback();
                this_.close();
            }
        }
    });
    
    return window;
}